﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Zyg.SSO.Web.Login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>登录 - Zyg SSO</title>
    <link href="style/login.css" rel="Stylesheet" type="text/css" charset="utf-8" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="wrapper">
        <div id="main">
            <div id="loginBox">
                <div id="logo">
                    <img src="images/logo.jpg" width="60" height="60" alt="江苏润澳花园大酒店" title="江苏润澳花园大酒店" />
                </div>
                <div id="ui">
                    <table cellpadding="5" cellspacing="0" align="center">
                        <tr>
                            <td>
                                邮&nbsp;&nbsp;箱:
                            </td>
                            <td>
                                <asp:TextBox ID="UserEmail" runat="server" CssClass="text"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                密&nbsp;&nbsp;码:
                            </td>
                            <td>
                                <asp:TextBox ID="UserPass" runat="server" TextMode="Password" CssClass="text"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                                <asp:Button ID="BtnSubmit" runat="server" Text="登  录" OnClick="BtnSubmit_Click" CssClass="btn" />
                            </td>
                        </tr>
                    </table>
                    <div id="msg">
                        <asp:Literal ID="Msg" runat="server"></asp:Literal>
                    </div>
                    <div id="exception">
                        <label>
                            <a href="User/RegisterUser.aspx">申请注册</a></label>
                        <label>
                            <a href="User/GetPassword.aspx">忘记密码?</a></label>
                    </div>
                </div>
            </div>
        </div>
        <div id="copyright">
            版权所有 &copy; 2009 Zyg SSO.</div>
    </div>
    </form>

    <script type="text/javascript" src="script/jquery/jquery-1.2.6.min.js"></script>

    <script type="text/javascript">
        $(function() {
            var msg = $("#msg");
            $("#UserEmail").bind("blur", function() {
                var emailReg = new RegExp('^([-\\w\\.0-9]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$');

                if (emailReg.test($(this).val())) {
                } else {
                    msg.html('邮箱格式不合法');
                }
            });
            $("#UserPass").blur(function() {
                if ($(this).val().length == 0) {
                    msg.html('密码不能为空');
                } else { msg.html(''); }
            });
            $("#BtnSubmit").click(function(e) {
                var emailReg = new RegExp('^([-\\w\\.0-9]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$');
                if (emailReg.test($("#UserEmail").val()) &&
                    $("#UserPass").val().length != 0) {
                } else {
                    msg.html('您的输入不合法,请重新输入');
                    e.preventDefault();
                }
            });
        });
    </script>

</body>
</html>
